	_arry = _this;
	_heloname = _arry select 0;
	_callsign = _arry select 1;
	_home = _arry select 2;
	_airport = _arry select 3;
	_egress = _arry select 4;
	_ingress = _arry select 5;
	_wepType1 = _arry select 6;
	_wepClass1 = _arry select 7;
	_wepType2 = _arry select 8;
	_wepClass2 = _arry select 9;
	_helo = _arry select 0;
	_class = typeof _helo;

// hint format ["%1",_this];

// player globalchat format ["this is the new class structure - %1",_class];

if(_helo getVariable "RUM_inFlight")exitwith{hint "helo in flight";};

_helo setVariable ["RUM_inFlight", true, true];

_paytar = [];
RUM_ASclick = false;

openMap [true,true];
for [{_n=1},{_n<=3},{_n=_n+1}] do {
	_mkrname = "";
	_type = "";
	_hint = "";
	switch (_n) do {
		case 1: {
			_mkrname = format ["%1target",_helo];
			_type = "Destroy";
			_hint = "Select Target Area for CAS";
		};
		case 2: {
			_mkrname = format ["%1ingress",_helo];
			_type = "mil_start";
			_hint = "Select Ingress Point";
		};
		case 3: {
			_mkrname = format ["%1egress",_helo];
			_type = "mil_end";
			_hint = "Select Egress Point";
		};
		default {
			hint "shit";	
		};
	};
	_asloc = createMarkerLocal [_mkrname, [0,0,0]];
	_asloc setMarkerShapeLocal "ICON";
	_mkrname setMarkerTypeLocal _type;
	_stgtar = "";
	if(_n == 1)then{_stgtar = format ["'%1' setMarkerPosLocal _pos,RUM_ASclick = [_pos] call ROEzone",_mkrname]}else{_stgtar = format ["'%1' setMarkerPosLocal _pos,RUM_ASclick = true",_mkrname]};
	onMapSingleClick _stgtar;
	titleText [_hint, "PLAIN DOWN"];
	waitUntil {RUM_ASclick};
	if((_n == 2) or (_n == 3)) then {
		_mkrname2 = format ["%1target",_helo];
		_mkrname setMarkerDirLocal ((getMarkerPos _mkrname2 select 0)-(getMarkerPos _mkrname select 0)) atan2 ((getMarkerPos _mkrname2 select 1)-(getMarkerPos _mkrname select 1));
	};
	onMapSingleClick "";
	RUM_ASclick = false;
};
titleFadeOut 0;
sleep 1;
openMap [false,false];

	// delete and replace the static helo - client side
	_heloNewName = str(_heloname);

	// grabs the position of the helo prior to being deleted so it can be repositioned at the same place on an LHD
	_heliPosASL = [getposASL _helo select 0, getposASL _helo select 1,(getposASL _helo select 2)*0 + 17.5];

	deleteVehicle _heloname;
	_spwndir = getdir _home;
	_helo = createVehicle [_class, getPos _home, [], 0, "NONE"];
	_helo setVehicleVarName _heloNewName;

	
	// checks to see if the helo is either on a LHD deck over water or on land
	if (surfaceIsWater (getpos _home)) then {
		// player sidechat format["Heli is on LHD or Ship, %1",_helo];
		_helo setPosASL _heliPosASL;
	}else{
		// player sidechat format["Heli is not over water, %1",_helo];
		_helo setpos getpos _home;
	};
	
	_helo setdir _spwndir;
	_helo setVariable ["RUM_inFlight", true, true];
	_arry = [_helo,_callsign,_home,_airport,_egress,_ingress,_wepType1,_wepClass1,_wepType2,_wepClass2];

	// player sidechat format["New Array is: %1", _arry];

	// create units to fly helo - client side
	sleep 1.5;
	_grp = createGroup side player;
	_pilot = _grp createUnit [RUM_AHEL_Pilot, getpos _home, [], 0, "FORM"];
	_pilot moveinDriver _helo;
	_gunner = _grp createUnit [RUM_AHEL_Pilot, getpos _home, [], 0, "FORM"];
	_gunner moveinGunner _helo;

	if!(_gunner in crew _helo)then{deleteVehicle _gunner};

["immediatestrike",[player,_pilot,_callsign]] execVM (RUM_PATH+"AHel\radiodialogs.sqf");
sleep 16;

//
_helo engineOn true;

for [{_n=1},{_n<=5},{_n=_n+1}] do {
	_mkrname = "";
	switch (_n) do {
		case 1: {
			[_mkrname,_grp,_egress] call RUM_AHel_moveWPTakeoff; [_mkrname,_grp,_egress] call RUM_AHel_moveWPNormal;
		};
		case 2: {
			_mkrname = format ["%1ingress",_helo];
			[_mkrname,_grp] call RUM_AHel_movewaypoint;
		};
		case 3: {
			_mkrname = format ["%1target",_helo];
			[_mkrname,_grp] call RUM_AHel_SAD;
		};
		case 4: {
			_mkrname = format ["%1egress",_helo];
			[_mkrname,_grp] call RUM_AHel_movewaypoint;
		};
		case 5: {
			[_mkrname,_grp,_ingress] call RUM_AHel_LandHome;
		};
		default {
			hint "shit";	
		};
	};
};

_end = format ["%1",_helo];
sleep 5;
waitUntil{(!alive _helo) OR (RUM_AHel_endflight == _end)};

	// hint "deleting pilots and stuff";
	sleep 1.5;
	_pilot action ["engineOff", _helo];
	doGetOut [_pilot,_gunner];
	sleep 1;
	unassignVehicle _pilot;
	deleteVehicle _pilot;
	unassignVehicle _gunner;
	deleteVehicle _gunner;
	deleteVehicle _lz;

	// delete all the markers that were created for this instance.
	_mkrname1 = format ["%1ingress",_helo];
	_mkrname2 = format ["%1target",_helo];
	_mkrname3 = format ["%1egress",_helo];
	deletemarkerLocal _mkrname1;
	deletemarkerLocal _mkrname2;
	deletemarkerLocal _mkrname3;


	sleep 5;
	// hint "end flight wait ended";
	if ((alive _helo) and (count(crew _helo) == 0)) then {
		player sidechat format ["%1 has landed safely.", _callsign];
		// hintsilent format ["%1 has landed safely.", _callsign];
		sleep 2;
		player sidechat format ["%1 is being serviced at this time and will be avaiable in %2 mics.", _callsign, (RUM_AHEL_ReSupTime/60)];
		// hintsilent format ["%1 is being serviced at this time and will be avaiable in %2 mics.", _callsign, (RUM_AHEL_ReSupTime/60)];
	// checks to see if the helo is either on a LHD deck over water or on land
		if (surfaceIsWater (getpos _home)) then {
			// player sidechat format["Heli is on LHD or Ship, %1",_helo];
			_helo setPosASL _heliPosASL;
		}else{
			// player sidechat format["Heli is not over water, %1",_helo];
			_helo setpos getpos _home;
		};
		_helo setdir getdir _home;
		_helo setDamage 0;
		_helo setFuel 1;
		_mags = getArray (configFile>>"cfgVehicles">>typeOf _helo>>"Turrets">>"MainTurret">>"magazines");
		{_helo removeMagazine _x} forEach magazines _helo;
		{_helo addMagazine _x} forEach _mags;
	};

	// this will add the vehicle back to the RUM PDA when resupply has finished. (still has an issue with var passed back)
	// player sidechat format["%1",_arry];

	sleep RUM_AHEL_ReSupTime;
	
	RUM_AHelAircraft = RUM_AHelAircraft + [_arry];
	_helo setVariable ["RUM_inFlight", false, true];

if(true)exitwith{};
